@extends('home.layout.layout')
@section('title',"我的发帖")

@section('con')

<div class="hp-wrap">
    <div id="container">
        <div id="container_padd">
            <div id="indexline">
                <div id="sidenav">
                    <ul>
                        <li>
                            <a  href="{{url('/home/mypage/post/')}}" class="selected" >
                                我的发帖
                            </a>
                        </li>
                        <li>
                            <a  href="{{url('/home/mypage/follow/')}}">
                                我的跟帖
                            </a>
                        </li>
                        <li>
                            <a href="{{url('/home/mypage/collect/')}}">
                                我的收藏
                            </a>
                        </li>
                      
                        
                    </ul>
                </div>   
                </div>
                <div id="main" style='position:absolute;left: 242px;'>
                    <center>
                        <h1>
                            <b>我的发帖</b>
                        </h1>
                    </center>
                    <div class="list">
                            <?php 
                                foreach($post as $k=>$v){
                            ?>
                            
                   
                            <ul>
                                <li>
                                    <span class="textSpan">
                                        <a href="#" target="_blank" title="{{$v->pname}}">
                                            {{$v->pname}}
                                        </a>
                                        &nbsp;&nbsp;&nbsp;
                                        <em class="f666">
                                            {{$v->ctr}}点击量
                                        </em>
                                        <em class="f666">
                                            {{$v->fnum}}回复
                                        </em>
                                    </span>
                                    <span class="forum">
                                        <a target="_blank" href="#" class="f666">
                                            &nbsp;&nbsp;&nbsp;&nbsp;{{$v->sname}}
                                        </a>
                                        <a target="_blank" href="#" class="f666">
                                              | {{$v->bname}}
                                        </a>
                                    </span>                               
                                    <button class="btn btn-outline btn-link delete" type="button" pid="{{$v->pid}}" style='font-size:12px;float:right;'>删除</button>
                                    <hr>
                                </li>                                                                         
                            </ul>
                        <?php 
                            }
                         ?>
                    </div>
                </div>
                <div id="sidebar">
                   <div>
                            <div id="top10">
                                <div class="top10_menu">
                                    <h3>
                                        点击量排行
                                    </h3>
                                    
                                </div>
                                <div id="listday" class="ol" style="display: block;">
                                    <ol>
                                        @foreach($order as $k=>$v)
                                        <li class="num0{{$k+1}} mouseover">
                                            
                                            <div class="full-text">
                                                <a href="#" target="_blank" class="c_tit">
                                                    {{$v->pname}}
                                                </a>
                                            </div>
                                            <div >
                                                <h4>
                                                    <a href="#" target="_blank">
                                                        {{$v->pname}}
                                                    </a>
                                                </h4>
                                                <p>
                                                    回复数: {{$v->fnum}}&nbsp;&nbsp;点击量{{$v->ctr}}
                                                </p>
                                                
                                            </div>                                         
                                            
                                        </li>
                                        @endforeach
                                    </ol>
                                </div>
                                
                                <a class="more-hot-rank-link" href="#">
                                    更多今日热门>>
                                </a>
                            </div>
                        </div>
                   
                </div>
                <div class="clearfix">
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
@section('js')
    <script type="text/javascript">

    //签到
    $('.dao').click(function(){
        $.get('/home/mypage/qiandao',{test:1},function(data){
                if(data==1){
                    alert('签到成功');
                    return true;
                }else if(data==2){
                    alert('您已签到');
                    return false;
                }
                else{
                    alert('您还未登录...');
                    return false;
                }
            })
    });

    //删除
    $('.delete').click(function(){
        var pid=$(this).attr('pid');
        if(confirm('确定删除吗?')){
            $.get('/home/mypage/delete',{pid:pid},function(data){
                if(data==1){
                    alert('删除成功');
                    location.reload();
                }else{
                    alert('删除失败');
                }
            }) 
        }
    })

    </script>
@endsection